package me.zhanshi123.vipsystem.task;

import me.zhanshi123.vipsystem.Main;
import me.zhanshi123.vipsystem.api.VipSystemAPI;

public class CheckAllTask extends VipSystemTask {
    @Override
    public void onRun(int i) {
        VipSystemAPI.getInstance().getOnlinePlayers().stream()
                .forEach(player -> Main.getInstance().getServer().getScheduler().scheduleTask(new CheckVipTask(player)));
        Main.getDataBase().getAllFunctions().forEach(
                storedFunction -> Main.getInstance().getServer().getScheduler().scheduleTask(new CheckFunctionTask(storedFunction)));
    }
}
